package org.feng.controller;

import org.feng.service.Test;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 测试
 *
 * @version v1.0
 * @author: fengjinsong
 * @date: 2022年05月05日 15时43分
 */
@RestController
public class TestController {

    @Resource
    private Test test;

    @GetMapping("/testMaster")
    public Map<String, Object> testMaster() {
        return test.dbTestMaster();
    }

    @GetMapping("/testSlave1")
    public Map<String, Object> testSlave1() {
        return test.dbTestSlave1();
    }

    @GetMapping("/test")
    public List<Map<String, Object>> test() {
        Map<String, Object> map1 = test.dbTestMaster();
        Map<String, Object> map2 = test.dbTestSlave1();
        return List.of(map1, map2);
    }
}
